package phapp.model.custom;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import javacommon.base.BaseEntity;

/**
 * Title: t_custom_favorite 数据类 POJO Description: DAO层映射到数据类,页面封装数据映射到数据类
 * Copyright: Copyright (c) 2012-10 Company:
 * 
 * @author you name
 * @version 1.0
 */

public class CustomFavorite extends BaseEntity
{

   // date formats
   public static final String FORMAT_FAV_DATE = DATE_TIME_FORMAT;
   public static final String FORMAT_CREATE_TIME = DATE_TIME_FORMAT;

   // columns START
   /** dataId */
   private java.lang.Integer dataId;
   /** custId */
   private java.lang.Integer custId;
   private java.lang.String constellation;
   /** luckFortune */
   private java.lang.String luckFortune;
   /** luckColor */
   private java.lang.String luckColor;
   /** luckPos */
   private java.lang.String luckPos;
   /** luckArticle */
   private java.lang.String luckArticle;
   /** luckValue */
   private java.lang.Integer luckValue;
   /** favCode */
   private java.lang.String favCode;
   /** favDate */
   private java.sql.Timestamp favDate;
   /** createTime */
   private java.sql.Timestamp createTime;

   private java.util.ArrayList idList;

   // columns END

   public CustomFavorite()
   {
   }

   public java.lang.String getConstellation()
   {
      return constellation;
   }

   public void setConstellation(java.lang.String constellation)
   {
      this.constellation = constellation;
   }

   public CustomFavorite(java.lang.Integer dataId)
   {
      this.dataId = dataId;
   }

   public void setId(java.lang.Integer value)
   {
      this.dataId = value;
   }

   public java.lang.Integer getId()
   {
      return this.dataId;
   }
   
   public void setDataId(java.lang.Integer value)
   {
      this.dataId = value;
   }

   public java.lang.Integer getDataId()
   {
      return this.dataId;
   }

   public void setCustId(java.lang.Integer value)
   {
      this.custId = value;
   }

   public java.lang.Integer getCustId()
   {
      return this.custId;
   }

   public void setLuckFortune(java.lang.String value)
   {
      this.luckFortune = value;
   }

   public java.lang.String getLuckFortune()
   {
      return this.luckFortune;
   }

   public void setLuckColor(java.lang.String value)
   {
      this.luckColor = value;
   }

   public java.lang.String getLuckColor()
   {
      return this.luckColor;
   }

   public void setLuckPos(java.lang.String value)
   {
      this.luckPos = value;
   }

   public java.lang.String getLuckPos()
   {
      return this.luckPos;
   }

   public void setLuckArticle(java.lang.String value)
   {
      this.luckArticle = value;
   }

   public java.lang.String getLuckArticle()
   {
      return this.luckArticle;
   }

   public void setLuckValue(java.lang.Integer value)
   {
      this.luckValue = value;
   }

   public java.lang.Integer getLuckValue()
   {
      return this.luckValue;
   }

   public void setFavCode(java.lang.String value)
   {
      this.favCode = value;
   }

   public java.lang.String getFavCode()
   {
      return this.favCode;
   }

   public String getFavDateString()
   {
      return date2String(getFavDate(), FORMAT_FAV_DATE);
   }

   public void setFavDateString(String value)
   {
      setFavDate(string2Date(value, FORMAT_FAV_DATE, java.sql.Timestamp.class));
   }

   public void setFavDate(java.sql.Timestamp value)
   {
      this.favDate = value;
   }

   public java.sql.Timestamp getFavDate()
   {
      return this.favDate;
   }

   public String getCreateTimeString()
   {
      return date2String(getCreateTime(), FORMAT_CREATE_TIME);
   }

   public void setCreateTimeString(String value)
   {
      setCreateTime(string2Date(value, FORMAT_CREATE_TIME, java.sql.Timestamp.class));
   }

   public void setCreateTime(java.sql.Timestamp value)
   {
      this.createTime = value;
   }

   public java.sql.Timestamp getCreateTime()
   {
      return this.createTime;
   }

   public java.util.ArrayList getIdList()
   {
      return idList;
   }

   public void setIdList(java.util.ArrayList idList)
   {
      this.idList = idList;
   }

   /** 手动增加属性后,toString,hashCode,equals都要修改 */
   public String toString()
   {
      return new ToStringBuilder(this).append("DataId", getDataId()).append("CustId", getCustId())
               .append("LuckFortune", getLuckFortune()).append("LuckColor", getLuckColor()).append("LuckPos", getLuckPos())
               .append("LuckArticle", getLuckArticle()).append("LuckValue", getLuckValue()).append("FavCode", getFavCode())
               .append("FavDate", getFavDate()).append("CreateTime", getCreateTime()).toString();
   }

   public int hashCode()
   {
      return new HashCodeBuilder().append(getDataId()).append(getCustId()).append(getLuckFortune()).append(getLuckColor())
               .append(getLuckPos()).append(getLuckArticle()).append(getLuckValue()).append(getFavCode()).append(getFavDate())
               .append(getCreateTime()).toHashCode();
   }

   public boolean equals(Object obj)
   {
      if(obj instanceof CustomFavorite == false) return false;
      if(this == obj) return true;
      CustomFavorite other = (CustomFavorite) obj;
      return new EqualsBuilder().append(getDataId(), other.getDataId()).append(getCustId(), other.getCustId())
               .append(getLuckFortune(), other.getLuckFortune()).append(getLuckColor(), other.getLuckColor())
               .append(getLuckPos(), other.getLuckPos()).append(getLuckArticle(), other.getLuckArticle())
               .append(getLuckValue(), other.getLuckValue()).append(getFavCode(), other.getFavCode())
               .append(getFavDate(), other.getFavDate()).append(getCreateTime(), other.getCreateTime()).isEquals();
   }
}
